#include <maya/MString.h>
#include "..\CommLib\CommStructs.h"
class Connection;

class VNet {

private:

	struct tSendData {
		char* pBytes;
		u_int sizeInBytes;
		u_int ID;
	};
	
	static bool g_isMonitoring;
	static HANDLE g_hMontiorConnection;
	static DWORD WINAPI MonitorConnection(LPVOID);

public:
#pragma message("MOVE WEN DONE WITH GEOM SEND")
	static Connection g_Client;
	static MString g_Status;

	static bool Connect();
	static bool Disconnect();
	static bool IsConnected();
	static MString Status();

	static MString HostAddress;

	static bool SendTransform(MObject& childObject, MObject& transformObject);
	static bool SendMesh_Geometry(MObject& targetObject, bool remove);
	static bool SendMesh_Parameters(MObject& targetObject, int instanced, int deformation, float deformationscale );
	static bool SendPart_Shader(MObject& targetObject, uint part, MString& filename, bool remove);
	static bool SendPart_ChannelChange(MObject& targetObject, uint part, MString& channel, bool remove);
	static bool SendPart_SamplerChange(MObject& targetObject, MObject& samplerObject, uint part, MString& channel, bool remove);

	static bool SendInstancing_ChildMask(MObject& targetObject, MObject& childObject, MString& filename);
	static bool SendInstancing_ChildSampler(MObject& targetObject, MObject& childObject, MObject& sampler, MString& channel);
	static bool SendInstancing_ChildUV(MObject& targetObject, MObject& childObject, int uvchannel);
	static bool SendInstancing_ChildChange(MObject& targetObject, MObject& childObject, bool remove);
		
	/*static bool SendSampler(MObject& targetObject, MObject& samplerObject, uint partIndex, MString& channel, bool remove);*/
	/*static bool SendSampler(MObject& targetObject,MObject& samplerObject,  MString& childObject, MString& channel, bool remove);*/
	
	static bool SendScene_SamplerChange(MObject& samplerObject);
	static bool SendScene_Selected(MObjectArray& targetObjects);
	static bool SendScene_Light(MObject& targetLight, bool remove);
	static bool SendScene_ViewPoint();

	static bool QueryServer(QuerysStructs::tViewerInfoQuery* pQuery, char** pDataOut, uint *pDataSize);

	//static bool SendSamplers(MObject& targetObject);
};
